import { defHttp } from '/@/utils/http/axios';
import { stringFormat } from '/@/utils/common/compUtils';

enum Api {
  listCementByUser = '/api-upms/notify/user-announcement/unread',
  editCementSend = '/api-upms/notify/user-announcement/read/{0}',
  readAllMsg = '/api-upms/notify/user-announcement/readAll',
}

/**
 * 列表接口
 * @param params
 */
export const listCementByUser = (params?) => defHttp.get({ url: Api.listCementByUser, params });

export const editCementSend = (anntId, params?) => {
  const url = stringFormat(Api.editCementSend, anntId);
  defHttp.post({ url: url, params: { anntId, ...params } });
};

/**
 * 清空全部未读消息
 */
export const readAllMsg = () => defHttp.post({ url: Api.readAllMsg }, { isTransformResponse: false });
